package com.dgut.epidemic.controller;

import com.dgut.epidemic.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author: wuhaoduan
 * Date: 2021/6/5 11:43
 */
@Controller
public class HomeController {

    @Autowired
    private UserService userService;

    // 后台-登录界面
    @GetMapping("/admin/login")
    public String adminLogin() {
        return "admin_login";
    }

    // 后台-首页
    @GetMapping("/admin")
    public String adminIndex(Model model) {
        model.addAttribute("roles",userService.getUserNow().getRoles());
        return "first";
    }

}
